import { defineStore } from "pinia";

const useUserStore=defineStore('user',{
	state:()=>({
		id:uni.getStorageSync('phone'),
		modalShow:false
	}),
	actions:{
		confirm(homeStore,hospitalStore,goleStore){
			hospitalStore.stopTime()
			goleStore.stopTime()
			uni.clearStorageSync();
			homeStore.$reset()
			hospitalStore.$reset()
			goleStore.$reset()
			uni.reLaunch({
				url:'/pages/login/login'
			})
			this.modalShow=false
		},
		cancel(){
			this.modalShow=false
		},
		pwdPath(){
			uni.navigateTo({
				url:'/pages/changePwd/changePwd'
			})
		},
		aboutPath(){
			uni.navigateTo({
				url:'/pages/about/about'
			})
		},
		usePath(){
			uni.navigateTo({
				url:'/pages/use/use'
			})
		},
		feedbackPath(){
			uni.navigateTo({
				url:'/pages/feedback/feedback'
			})
		},
		historyPath(){
			uni.navigateTo({
				url:'/pages/history/history'
			})
		},
		userInfoPath(){
			uni.navigateTo({
				url:'/pages/userInfo/userInfo'
			})
		}
	}
})
export default useUserStore;